home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / travrusa.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  15KB  |  419 lines

  1. /****************************************************************************
  2. Traverse USA Driver
  3.  
  4. Lee Taylor
  5. John Clegg
  6.  
  7. Loosely based on the our previous 10 Yard Fight driver.
  8.  
  9.  
  10. - I haven't understood how char/sprite priority works. This is used for
  11.   tunnels. I hacked it just by making the two needed colors opaque. They
  12.   don't seem to be used anywhere else.
  13.  
  14. ****************************************************************************/
  15.  
  16. #include "driver.h"
  17. #include "sndhrdw/irem.h"
  18.  
  19. extern unsigned char *spriteram;
  20. extern size_t spriteram_size;
  21.  
  22. extern unsigned char *travrusa_videoram;
  23.  
  24. void travrusa_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  25. int travrusa_vh_start(void);
  26. WRITE_HANDLER( travrusa_videoram_w );
  27. WRITE_HANDLER( travrusa_scroll_x_low_w );
  28. WRITE_HANDLER( travrusa_scroll_x_high_w );
  29. WRITE_HANDLER( travrusa_flipscreen_w );
  30. void travrusa_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  31.  
  32.  
  33.  
  34. static struct MemoryReadAddress readmem[] =
  35. {
  36.     { 0x0000, 0x7fff, MRA_ROM },
  37.     { 0x8000, 0x8fff, MRA_RAM },        /* Video and Color ram */
  38.     { 0xd000, 0xd000, input_port_0_r },    /* IN0 */
  39.     { 0xd001, 0xd001, input_port_1_r },    /* IN1 */
  40.     { 0xd002, 0xd002, input_port_2_r },    /* IN2 */
  41.     { 0xd003, 0xd003, input_port_3_r },    /* DSW1 */
  42.     { 0xd004, 0xd004, input_port_4_r },    /* DSW2 */
  43.     { 0xe000, 0xefff, MRA_RAM },
  44.     { -1 }    /* end of table */
  45. };
  46.  
  47. static struct MemoryWriteAddress writemem[] =
  48. {
  49.     { 0x0000, 0x7fff, MWA_ROM },
  50.     { 0x8000, 0x8fff, travrusa_videoram_w, &travrusa_videoram },
  51.     { 0x9000, 0x9000, travrusa_scroll_x_low_w },
  52.     { 0xa000, 0xa000, travrusa_scroll_x_high_w },
  53.     { 0xc800, 0xc9ff, MWA_RAM, &spriteram, &spriteram_size },
  54.     { 0xd000, 0xd000, irem_sound_cmd_w },
  55.     { 0xd001, 0xd001, travrusa_flipscreen_w },    /* + coin counters */
  56.     { 0xe000, 0xefff, MWA_RAM },
  57.     { -1 }    /* end of table */
  58. };
  59.  
  60.  
  61.  
  62. INPUT_PORTS_START( travrusa )
  63.     PORT_START    /* IN0 */
  64.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  65.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  66.     /* coin input must be active for 19 frames to be consistently recognized */
  67.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 19 )
  68.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  69.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  70.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  71.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  72.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  73.  
  74.     PORT_START    /* IN1 */
  75.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  76.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
  77.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  78.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  79.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  80.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
  81.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  82.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
  83.  
  84.     PORT_START    /* IN2 */
  85.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  86.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
  87.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  88.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  89.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  90.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  91.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  92.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  93.  
  94.     PORT_START    /* DSW1 */
  95.     PORT_DIPNAME( 0x03, 0x03, "Fuel Reduced on Collision" )
  96.     PORT_DIPSETTING(    0x03, "Low" )
  97.     PORT_DIPSETTING(    0x02, "Med" )
  98.     PORT_DIPSETTING(    0x01, "Hi" )
  99.     PORT_DIPSETTING(    0x00, "Max" )
  100.     PORT_DIPNAME( 0x04, 0x04, "Fuel Consumption" )
  101.     PORT_DIPSETTING(    0x04, "Low" )
  102.     PORT_DIPSETTING(    0x00, "Hi" )
  103.     PORT_DIPNAME( 0x08, 0x00, "Allow Continue" )
  104.     PORT_DIPSETTING(    0x08, DEF_STR( No ) )
  105.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  106.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) )
  107.     PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
  108.     PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
  109.     PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
  110.     PORT_DIPSETTING(    0xd0, DEF_STR( 3C_1C ) )
  111.     PORT_DIPSETTING(    0xe0, DEF_STR( 2C_1C ) )
  112.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  113.     PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
  114.     PORT_DIPSETTING(    0x60, DEF_STR( 1C_3C ) )
  115.     PORT_DIPSETTING(    0x50, DEF_STR( 1C_4C ) )
  116.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  117.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_6C ) )
  118.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_7C ) )
  119.  
  120.     /* PORT_DIPSETTING( 0x10, "INVALID" ) */
  121.     /* PORT_DIPSETTING( 0x00, "INVALID" ) */
  122.  
  123.     PORT_START    /* DSW2 */
  124.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  125.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  126.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  127.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
  128.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  129.     PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
  130.     PORT_DIPNAME( 0x04, 0x04, "Coin Mode" )
  131.     PORT_DIPSETTING(    0x04, "Mode 1" )
  132.     PORT_DIPSETTING(    0x00, "Mode 2" )
  133.     PORT_DIPNAME( 0x08, 0x08, "Speed Type" )
  134.     PORT_DIPSETTING(    0x08, "M/H" )
  135.     PORT_DIPSETTING(    0x00, "Km/H" )
  136.     /* In stop mode, press 2 to stop and 1 to restart */
  137.     PORT_BITX   ( 0x10, 0x10, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Stop Mode", IP_KEY_NONE, IP_JOY_NONE )
  138.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  139.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  140.     PORT_DIPNAME( 0x20, 0x20, "Title" )
  141.     PORT_DIPSETTING(    0x20, "Traverse USA" )
  142.     PORT_DIPSETTING(    0x00, "Zippy Race" )
  143.     PORT_BITX(    0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  144.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  145.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  146.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  147. INPUT_PORTS_END
  148.  
  149. /* same as travrusa, no "Title" switch */
  150. INPUT_PORTS_START( motorace )
  151.     PORT_START    /* IN0 */
  152.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
  153.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
  154.     /* coin input must be active for 19 frames to be consistently recognized */
  155.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN3, 19 )
  156.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
  157.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  158.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  159.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  160.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  161.  
  162.     PORT_START    /* IN1 */
  163.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY )
  164.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY )
  165.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  166.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  167.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  168.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 )
  169.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  170.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 )
  171.  
  172.     PORT_START    /* IN2 */
  173.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_2WAY | IPF_COCKTAIL )
  174.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_2WAY | IPF_COCKTAIL )
  175.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  176.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  177.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN2 )
  178.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  179.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  180.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  181.  
  182.     PORT_START    /* DSW1 */
  183.     PORT_DIPNAME( 0x03, 0x03, "Fuel Reduced on Collision" )
  184.     PORT_DIPSETTING(    0x03, "Low" )
  185.     PORT_DIPSETTING(    0x02, "Med" )
  186.     PORT_DIPSETTING(    0x01, "Hi" )
  187.     PORT_DIPSETTING(    0x00, "Max" )
  188.     PORT_DIPNAME( 0x04, 0x04, "Fuel Consumption" )
  189.     PORT_DIPSETTING(    0x04, "Low" )
  190.     PORT_DIPSETTING(    0x00, "Hi" )
  191.     PORT_DIPNAME( 0x08, 0x00, "Allow Continue" )
  192.     PORT_DIPSETTING(    0x08, DEF_STR( No ) )
  193.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  194.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coinage ) )
  195.     PORT_DIPSETTING(    0xa0, DEF_STR( 6C_1C ) )
  196.     PORT_DIPSETTING(    0xb0, DEF_STR( 5C_1C ) )
  197.     PORT_DIPSETTING(    0xc0, DEF_STR( 4C_1C ) )
  198.     PORT_DIPSETTING(    0xd0, DEF_STR( 3C_1C ) )
  199.     PORT_DIPSETTING(    0xe0, DEF_STR( 2C_1C ) )
  200.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  201.     PORT_DIPSETTING(    0x70, DEF_STR( 1C_2C ) )
  202.     PORT_DIPSETTING(    0x60, DEF_STR( 1C_3C ) )
  203.     PORT_DIPSETTING(    0x50, DEF_STR( 1C_4C ) )
  204.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_5C ) )
  205.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_6C ) )
  206.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_7C ) )
  207.  
  208.     /* PORT_DIPSETTING( 0x10, "INVALID" ) */
  209.     /* PORT_DIPSETTING( 0x00, "INVALID" ) */
  210.  
  211.     PORT_START    /* DSW2 */
  212.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  213.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  214.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  215.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
  216.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  217.     PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
  218.     PORT_DIPNAME( 0x04, 0x04, "Coin Mode" )
  219.     PORT_DIPSETTING(    0x04, "Mode 1" )
  220.     PORT_DIPSETTING(    0x00, "Mode 2" )
  221.     PORT_DIPNAME( 0x08, 0x08, "Speed Type" )
  222.     PORT_DIPSETTING(    0x08, "M/H" )
  223.     PORT_DIPSETTING(    0x00, "Km/H" )
  224.     /* In stop mode, press 2 to stop and 1 to restart */
  225.     PORT_BITX   ( 0x10, 0x10, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Stop Mode", IP_KEY_NONE, IP_JOY_NONE )
  226.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  227.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  228.     PORT_DIPNAME( 0x20, 0x20, "Unknown" )
  229.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  230.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  231.     PORT_BITX(    0x40, 0x40, IPT_DIPSWITCH_NAME | IPF_CHEAT, "Invulnerability", IP_KEY_NONE, IP_JOY_NONE )
  232.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  233.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  234.     PORT_SERVICE( 0x80, IP_ACTIVE_LOW )
  235. INPUT_PORTS_END
  236.  
  237.  
  238.  
  239. static struct GfxLayout charlayout =
  240. {
  241.     8,8,    /* 8*8 characters */
  242.     1024,    /* 1024 characters */
  243.     3,    /* 3 bits per pixel */
  244.     { 2*1024*8*8, 1024*8*8, 0 },
  245.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  246.     { 8*0, 8*1, 8*2, 8*3, 8*4, 8*5, 8*6, 8*7 },
  247.     8*8    /* every char takes 8 consecutive bytes */
  248. };
  249. static struct GfxLayout spritelayout =
  250. {
  251.     16,16,    /* 16*16 sprites */
  252.     256,    /* 256 sprites */
  253.     3,    /* 3 bits per pixel */
  254.     { 2*256*16*16, 256*16*16, 0 },
  255.     { 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 },
  256.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
  257.     32*8    /* every sprite takes 32 consecutive bytes */
  258. };
  259.  
  260.  
  261. static struct GfxDecodeInfo gfxdecodeinfo[] =
  262. {
  263.     { REGION_GFX1, 0, &charlayout,      0, 16 },
  264.     { REGION_GFX2, 0, &spritelayout, 16*8, 16 },
  265.     { -1 } /* end of array */
  266. };
  267.  
  268.  
  269.  
  270. static struct MachineDriver machine_driver_travrusa =
  271. {
  272.     /* basic machine hardware */
  273.     {
  274.         {
  275.             CPU_Z80,
  276.             4000000,    /* 4 Mhz (?) */
  277.             readmem,writemem,0,0,
  278.             interrupt,1
  279.         },
  280.         IREM_AUDIO_CPU
  281.     },
  282.     57, 1790,    /* accurate frequency, measured on a Moon Patrol board, is 56.75Hz. */
  283.                 /* the Lode Runner manual (similar but different hardware) */
  284.                 /* talks about 55Hz and 1790ms vblank duration. */
  285.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  286.     0,
  287.  
  288.     /* video hardware */
  289.     32*8, 32*8, { 1*8, 31*8-1, 0*8, 32*8-1 },
  290.     gfxdecodeinfo,
  291.     128+32, 16*8+16*8,
  292.     travrusa_vh_convert_color_prom,
  293.  
  294.     VIDEO_TYPE_RASTER,
  295.     0,
  296.     travrusa_vh_start,
  297.     0,
  298.     travrusa_vh_screenrefresh,
  299.  
  300.     /* sound hardware */
  301.     0,0,0,0,
  302.     {
  303.         IREM_AUDIO
  304.     }
  305. };
  306.  
  307.  
  308. /***************************************************************************
  309.  
  310.   Game driver(s)
  311.  
  312. ***************************************************************************/
  313.  
  314.  
  315. ROM_START( travrusa )
  316.     ROM_REGION( 0x10000, REGION_CPU1 )    /* 64k for code */
  317.     ROM_LOAD( "zippyrac.000", 0x0000, 0x2000, 0xbe066c0a )
  318.     ROM_LOAD( "zippyrac.005", 0x2000, 0x2000, 0x145d6b34 )
  319.     ROM_LOAD( "zippyrac.006", 0x4000, 0x2000, 0xe1b51383 )
  320.     ROM_LOAD( "zippyrac.007", 0x6000, 0x2000, 0x85cd1a51 )
  321.  
  322.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu */
  323.     ROM_LOAD( "mr10.1a",      0xf000, 0x1000, 0xa02ad8a0 )
  324.  
  325.     ROM_REGION( 0x06000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  326.     ROM_LOAD( "zippyrac.001", 0x00000, 0x2000, 0xaa8994dd )
  327.     ROM_LOAD( "mr8.3c",       0x02000, 0x2000, 0x3a046dd1 )
  328.     ROM_LOAD( "mr9.3a",       0x04000, 0x2000, 0x1cc3d3f4 )
  329.  
  330.     ROM_REGION( 0x06000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  331.     ROM_LOAD( "zippyrac.008", 0x00000, 0x2000, 0x3e2c7a6b )
  332.     ROM_LOAD( "zippyrac.009", 0x02000, 0x2000, 0x13be6a14 )
  333.     ROM_LOAD( "zippyrac.010", 0x04000, 0x2000, 0x6fcc9fdb )
  334.  
  335.     ROM_REGION( 0x0220, REGION_PROMS )
  336.     ROM_LOAD( "mmi6349.ij",   0x0000, 0x0200, 0xc9724350 ) /* character palette - last $100 are unused */
  337.     ROM_LOAD( "tbp18s.2",     0x0100, 0x0020, 0xa1130007 ) /* sprite palette */
  338.     ROM_LOAD( "tbp24s10.3",   0x0120, 0x0100, 0x76062638 ) /* sprite lookup table */
  339. ROM_END
  340.  
  341. ROM_START( motorace )
  342.     ROM_REGION( 0x12000, REGION_CPU1 )    /* 64k for code */
  343.     ROM_LOAD( "mr.cpu",       0x10000, 0x2000, 0x89030b0c )    /* we load the ROM at 10000-11fff, */
  344.                                                         /* it will be decrypted at 0000 */
  345.     ROM_LOAD( "mr1.3l",       0x2000, 0x2000, 0x0904ed58 )
  346.     ROM_LOAD( "mr2.3k",       0x4000, 0x2000, 0x8a2374ec )
  347.     ROM_LOAD( "mr3.3j",       0x6000, 0x2000, 0x2f04c341 )
  348.  
  349.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for sound cpu */
  350.     ROM_LOAD( "mr10.1a",      0xf000, 0x1000, 0xa02ad8a0 )
  351.  
  352.     ROM_REGION( 0x06000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  353.     ROM_LOAD( "mr7.3e",       0x00000, 0x2000, 0x492a60be )
  354.     ROM_LOAD( "mr8.3c",       0x02000, 0x2000, 0x3a046dd1 )
  355.     ROM_LOAD( "mr9.3a",       0x04000, 0x2000, 0x1cc3d3f4 )
  356.  
  357.     ROM_REGION( 0x06000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  358.     ROM_LOAD( "mr4.3n",       0x00000, 0x2000, 0x5cf1a0d6 )
  359.     ROM_LOAD( "mr5.3m",       0x02000, 0x2000, 0xf75f2aad )
  360.     ROM_LOAD( "mr6.3k",       0x04000, 0x2000, 0x518889a0 )
  361.  
  362.     ROM_REGION( 0x0220, REGION_PROMS )
  363.     ROM_LOAD( "mmi6349.ij",   0x0000, 0x0200, 0xc9724350 ) /* character palette - last $100 are unused */
  364.     ROM_LOAD( "tbp18s.2",     0x0100, 0x0020, 0xa1130007 ) /* sprite palette */
  365.     ROM_LOAD( "tbp24s10.3",   0x0120, 0x0100, 0x76062638 ) /* sprite lookup table */
  366. ROM_END
  367.  
  368.  
  369.  
  370. void init_motorace(void)
  371. {
  372.     int A,i,j;
  373.     unsigned char *RAM = memory_region(REGION_CPU1);
  374.  
  375.  
  376.     /* The first CPU ROM has the address and data lines scrambled */
  377.     for (A = 0;A < 0x2000;A++)
  378.     {
  379.         int bit[13];
  380.  
  381.  
  382.         for (i = 0;i < 13;i++)
  383.             bit[i] = (A >> i) & 1;
  384.  
  385.         j =
  386.             (bit[11] <<  0) +
  387.             (bit[ 0] <<  1) +
  388.             (bit[ 2] <<  2) +
  389.             (bit[ 4] <<  3) +
  390.             (bit[ 6] <<  4) +
  391.             (bit[ 8] <<  5) +
  392.             (bit[10] <<  6) +
  393.             (bit[12] <<  7) +
  394.             (bit[ 1] <<  8) +
  395.             (bit[ 3] <<  9) +
  396.             (bit[ 5] << 10) +
  397.             (bit[ 7] << 11) +
  398.             (bit[ 9] << 12);
  399.  
  400.         for (i = 0;i < 8;i++)
  401.             bit[i] = (RAM[A + 0x10000] >> i) & 1;
  402.  
  403.         RAM[j] =
  404.             (bit[5] << 0) +
  405.             (bit[0] << 1) +
  406.             (bit[3] << 2) +
  407.             (bit[6] << 3) +
  408.             (bit[1] << 4) +
  409.             (bit[4] << 5) +
  410.             (bit[7] << 6) +
  411.             (bit[2] << 7);
  412.     }
  413. }
  414.  
  415.  
  416.  
  417. GAME( 1983, travrusa, 0,        travrusa, travrusa, 0,        ROT270, "Irem", "Traverse USA / Zippy Race" )
  418. GAME( 1983, motorace, travrusa, travrusa, motorace, motorace, ROT270, "Irem (Williams license)", "MotoRace USA" )
  419.